﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;
using System.IO;

namespace AccountingUpdater
{
    static class Program
    {
        public static myLogger mylog = new myLogger();
        public static ExceptionLogger exl = new ExceptionLogger();


        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            exl.NotificationType = NotificationType.Silent;

            exl.AddLogger(mylog);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Updater());     
        }
    }

    public class myLogger : LoggerImplementation
    {
        public override void LogError(string error)
        {
            StreamWriter file = new StreamWriter(Application.StartupPath + "\\log.log", true);
            file.Write(error);
            file.Flush();
            file.Close();
        }
    }
}
